<script type="text/javascript">
function theme_upload_success(file, data) {
    var json = $.parseJSON(data)    
    $(this).bjuiajax('ajaxDone', json)
    if (json[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
        $('#theme_pic_up').hide();
        $('#j_theme_pic').val(json.filename).trigger('validate')
        $('#j_theme_span_pic').html('<img src="'+ json.filename +'" width="100" />')
    }
}
</script>
<div class="bjui-pageContent" >
        <div data-layout-h="0">
                <!-- 内容区 -->
                <form action="{:U('Product/theme_add')}" class="pageForm nice-validator n-red" data-loadingmask='false' data-toggle="validate" novalidate="novalidate" data-reload-navtab="true" method="post" >
                        <input type="hidden" name="id" value="{$_GET.id|default=''}" />
                        <table class="table table-condensed table-hover">
                                <tr>
                                        <th ><label style='margin-left:40px;'>类别名称：</label></th>
                                        <td>
                                                <input type="text" data-rule="required" name="title" value="{$theme.title|default=''}" />
                                        </td>

                                </tr>
                                <tr>
                                        <th><label style='margin-left:40px;'>重定向字符：</label></th>
                                        <td>
                                                <input type="text" data-rule="required" name="write_string" value="{$theme.write_string|default=''}" />
                                        </td>

                                </tr>
                                <tr>
                                        <th><label style='margin-left:40px;'>状态：</label></th>
                                        <td>
                                                <select name="status" data-toggle="selectpicker"  >
                                                        <option value='1' {eq name='theme.status' value='1'} selected="selected" {/eq} >启用</option>
                                                        <option value='0' {eq name='theme.status' value='0'} selected="selected" {/eq}>禁用</option>
                                                </select>
                                        </td>

                                </tr>
                                <tr>
                                        <th><label style='margin-left:40px;'>图片：</label></th>
                                        <td>

                                                <div style="display:inline-block; vertical-align:middle;">
                                                        <div id="theme_pic_up" data-toggle="upload" data-uploader="{:U('Pub/image_upload?path=theme')}" 
                                                             data-file-size-limit="1024000000"
                                                             data-file-type-exts="*.jpg;*.png;*.gif;*.mpg"
                                                             data-multi="false"
                                                             data-on-upload-success="theme_upload_success"
                                                             data-icon="cloud-upload"
                                                             data-preview-img ='false'
                                                             data-auto='true'></div>
                                                        <input type="text"  name="images" value="{$theme.images|default=''}" id="j_theme_pic">
                                                        <br/>
                                                        <span id="j_theme_span_pic">
                                                                {notempty name='theme.images'}
                                                                <img src="{$theme.images|default=''}"  width='100'/>
                                                                {/notempty}
                                                        </span>
                                                </div>
                                        </td>

                                </tr>
                                <tr>
                                        <th><label style='margin-left:40px;'>Title：</label></th>
                                        <td>
                                                <textarea name="seo_title" cols="20" rows="4"  >{$theme.seo_title|default=''}</textarea>
                                        </td>

                                </tr>
                                <tr>
                                        <th><label style='margin-left:40px;'>Keyword：</label></th>
                                        <td>
                                                <textarea name="seo_keywords" cols="20" rows="4"   >{$theme.seo_keywords|default=''}</textarea>
                                        </td>

                                </tr>
                                <tr>
                                        <th><label style='margin-left:40px;'>Description：</label></th>
                                        <td>
                                                <textarea name="seo_description" cols="20" rows="4"  >{$theme.seo_description|default=''}</textarea>
                                        </td>

                                </tr>
                        </table>
                </form>
        </div>

</div>
<div class="bjui-pageFooter" border='none'>
        <ul>
                <li><button type="button" class="btn btn-close">关闭</button></li>
                <li><button type="submit" class="btn btn-default">提交</button></li>
        </ul>
</div>